#pragma once

#include "sfml/System.hpp"

class Camera
{
public:
	Camera();
	Camera(sf::Vector2f Pos, sf::Vector2f Size);
	Camera(float x, float y, float w, float h);
	~Camera() {}

	void SetPos(const sf::Vector2f& p);
	inline void SetPos(float x, float y) { SetPos(sf::Vector2f(x, y)); }
	inline void SetSize(const sf::Vector2f& size) { this->size.x = size.x; this->size.y = size.y; }
	inline sf::Vector2f GetPos() const { return pos; }
	inline float x() const { return pos.x; }
	inline float y() const { return pos.y; }
	inline void Move(float offsetX, float offsetY){SetPos(x()+offsetX,y()+offsetY);}
	inline void SetLimits(sf::Vector2f horizontal, sf::Vector2f vertical) { hlim = horizontal; vlim = vertical;}

	bool IsOnCamera(const sf::Vector2f& pos1, const sf::Vector2f& size1) const;

private:
	sf::Vector2f pos;					//the current position 
	sf::Vector2f size;					//the size of the camera
	sf::Vector2f hlim;					//the horizontal limit
	sf::Vector2f vlim;					//the vertical limit
};
